/*
	Copyright (C) 2009 jungil Han <jungil.Han@gmail.com>

	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef __MKANIMATION_H__
#define __MKANIMATION_H__

#include "../mkBase.h"
#include <QWidget>

class QTimer;

enum eANIMATION_TYPE {
	eResizeEffect = 0,
};

class mkAnimation : public QWidget {
	Q_OBJECT

public:
	mkAnimation( IN QWidget *a_pParent = 0 );
	~mkAnimation();

	void SetAnimationTick( IN int a_nMilliSec );
	void StartAnimationEffect( IN QImage *a_pSourceImage, IN QRect *a_pOriginImageRect, eANIMATION_TYPE a_eType );

	void SetMaximumAnimationSize( IN QSize *a_pMaxSize );
	QRect* GetAnimationImageRect();

	bool IsActivate();

protected:
	void ResizeEffect();

protected slots:
	void SlotAnimationEffect();

private:
	QImage *m_pSourceImage;
	QTimer *m_pAnimationTimer;

	QRect *m_pSourceImageRect;
	QRect *m_pAnimationImageRect;
	QSize *m_pMaxSize;

	int m_nMilliSec;
	bool m_bIsIncrease;
	eANIMATION_TYPE m_eType;
};

#endif /* __MKANIMATION_H__ */

